package com.vivo.util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import redis.clients.jedis.Jedis;

import java.util.List;


public class DimUtil {


  /*  private static void writeDimToRedis(Jedis jedis, String table, Long id, JSONObject dim) {
        String key = table + ":" + id;
        String value = dim.toJSONString();

        jedis.setex(key,2*24*60*60,value); // 对每条数据 设置过期时间
    }*/

    public static JSONObject readDimFromRedis(Jedis jedis, String table, Long id) {
        String key = table + ":" +id;
        String s = jedis.get(key);
        if (s != null) {
            return JSON.parseObject(s);
        }
        return null;

    }
}

